package com.deepocean.controller;

import com.deepocean.common.entity.ResultEntity;
import com.deepocean.entity.CurvedScreenCondition;
import com.deepocean.entity.CurvedScreenEntity;
import com.deepocean.service.ICurvedScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 弧形筛
 */
@RestController
@RequestMapping("/curvedScreen")
public class CurvedScreenController {

    @Autowired
    private ICurvedScreenService curvedScreenService;

    /**
     * 新增接口
     * @param curvedScreenEntity
     * @return
     */
    @PostMapping("/v1/add")
    public ResultEntity add(@RequestBody CurvedScreenEntity curvedScreenEntity) {
        return ResultEntity.success(curvedScreenService.add(curvedScreenEntity));
    }

    /**
     * 一小时内物料输入输出总和
     * @param deviceId
     * @return
     */
    @PostMapping("/v1/getInAndOutInHour")
    public ResultEntity getInAndOutInHour(@RequestParam String deviceId) {
        return ResultEntity.success(curvedScreenService.getInAndOutInHour(deviceId));
    }

    /**
     * 条件查询
     * @param curvedScreenCondition
     * @return
     */
    @PostMapping("/v1/getCurvedScreenByCondition")
    public ResultEntity getCurvedScreenByCondition(@RequestBody CurvedScreenCondition curvedScreenCondition) {
        return ResultEntity.success(curvedScreenService.getCurvedScreenByCondition(curvedScreenCondition));
    }

    /**
     * 根据设备型号获取理论数据
     * @return
     */
    @PostMapping("/v1/getTheoryData")
    public ResultEntity getTheoryData(String deviceType) {
        return ResultEntity.success("理论数据");
    }
}
